﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace zielonka.co.uk.extensions.system
{
    //Description:	Converts string to a title case.
    /*
        string s = "tHiS is a sTring TesT";
        Console.WriteLine("Title Case: {0}", s.ToTitleCase());

        // Output: This Is A String Test
    */

    public static partial class StringExtensions
    {
        public static string ToTitleCase(this string text)
        {
            System.Globalization.CultureInfo cultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture;
            System.Globalization.TextInfo textInfo = cultureInfo.TextInfo;
            return textInfo.ToTitleCase(text);
        }
    }
}
